/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package carcassonne.gameplay.listObjects;

import carcassonne.initialize.XmlParser;
import org.w3c.dom.Element;

/**
 *
 * @author tylerb
 */
public class GameTileType {
    private String id;
    private int quantity;
    private int side1;
    private int side2;
    private int side3;
    private int side4;
    private String cloister;
    private String image;

    public GameTileType(Element el) {
        
        //XmlParser xp = new XmlParser();
        
        this.setId(XmlParser.getIdValue(el));
        this.setQuantity(XmlParser.getIntValue(el,"quantity"));
        this.setSide1(XmlParser.getIntValue((Element) el.getElementsByTagName("sides").item(0),"side1"));
        this.setSide2(XmlParser.getIntValue((Element) el.getElementsByTagName("sides").item(0),"side2"));
        this.setSide3(XmlParser.getIntValue((Element) el.getElementsByTagName("sides").item(0),"side3"));
        this.setSide4(XmlParser.getIntValue((Element) el.getElementsByTagName("sides").item(0),"side4"));
        this.setCloister(XmlParser.getTextValue(el,"cloister"));
        this.setImage(XmlParser.getTextValue(el,"image"));
        //System.out.println(this.toString());

    }
    
    public GameTileType() {
        
    }

    public String toString() {
        String ret = "Id is "
                      + this.getId() 
                      + "\n"
                      + "Quantity is "
                      + this.getQuantity()
                      + "\n"
                      + "Side 1 is "
                      + this.getSide1()
                      + "\n"
                      + "Side 2 is "
                      + this.getSide2()
                      + "\n"
                      + "Side 3 is "
                      + this.getSide3()
                      + "\n"
                      + "Side 4 is "
                      + this.getSide4()
                      + "\n"
                      + "Cloister Ind "
                      + this.getCloister()
                      + "\n"
                      + "Image source is "
                      + this.getImage();
        return ret;
    } 

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public int getSide1() {
        return side1;
    }

    public void setSide1(int side1) {
        this.side1 = side1;
    }

    public int getSide2() {
        return side2;
    }

    public void setSide2(int side2) {
        this.side2 = side2;
    }

    public int getSide3() {
        return side3;
    }

    public void setSide3(int side3) {
        this.side3 = side3;
    }

    public int getSide4() {
        return side4;
    }

    public void setSide4(int side4) {
        this.side4 = side4;
    }

    public String getCloister() {
        return cloister;
    }

    public void setCloister(String cloister) {
        this.cloister = cloister;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

}
